#include <algorithm>
#include <vector>
#include <cmath>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <set>
#include <map>
#include <cstdlib>
#define LL long long
#define ldb long double
const ldb eps = 1e-9;
const ldb pi = fabsl(atan2(0.0, -1.0));
const int INF = 0x7f7f7f7f;
const LL LINF = 1ll << 60;
const ldb LDINF = 1e42;
#define nextLine() {int c = 0; while ((c = getchar()) != 10 && c != EOF);}
#define fill(a, c) memset(a, c, sizeof a)
#define debug(a) cerr << #a << " " << a;
#define addEdge(a, b) next[edges] = first[a]; first[a] = edges; end[edges] = b; edges++;
using namespace std;

vector <LL> a;
char c[4];
LL res;

void Load()
{
	int a1, b1, c1, d1;
	cin >> a1 >> b1 >> c1 >> d1;
	::a.push_back(a1);
	::a.push_back(b1);
	::a.push_back(c1);
	::a.push_back(d1);
	cin >> c[0] >> c[1] >> c[2];
}


void go(int i)
{
	if (i == 3)
	{
		
		if (a[0] < res)
		{
			res = a[0];
		}
		return;
	}
	int j, k;
	int t1, t2;
	vector <LL> t;
	for (j = 0; j < a.size(); j++)
	{
		for (k = j + 1; k < a.size(); k++)
		{
			t = a;
			if (c[i] == '+')
			{
				a.push_back(a[j] + a[k]);
				a.erase(a.begin() + k, a.begin() + k + 1);
				a.erase(a.begin() + j, a.begin() + j + 1);
			}
			else
			{
				a.push_back(a[j] * a[k]);
				a.erase(a.begin() + k, a.begin() + k + 1);
				a.erase(a.begin() + j, a.begin() + j + 1);
			}
			go(i + 1);
			a = t;
		}
	}
}

void Solve()
{
	res = LINF;
	go(0);
	cout << res;
}

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	#endif
	Load();
	Solve();
	return 0;
}